{*
* 2007-2012 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2012 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}

{include file="$tpl_dir./errors.tpl"}
{if $errors|@count == 0}
    <script type="text/javascript">
        var finalPrice = 0;
        function changePriceBySize(){
            finalPrice = productPrice ;
            for(var i = 0 ;i<customizationFields.length;i++){
                finalPrice *= $("#"+customizationFields[i][0]).val();
            }
            if(finalPrice!=0){
                $('.container-product-price').text(formatCurrency(finalPrice, currencyFormat, currencySign, currencyBlank))      
                $('#summary-price').text(formatCurrency(finalPrice, currencyFormat, currencySign, currencyBlank))
            }
            else{
                finalPrice = productPrice;
            }
            
        }
        // <![CDATA[
        var AttributesValue = new Array();
        {foreach from=$AllAttributes key=id_attribute item=value_attribute}
             AttributesValue[{$value_attribute.id_attribute}] = '{$value_attribute.name}'   
        {/foreach}
        function addInfo(step){
            if(step == 1){
                $("#exact-value").text(AttributesValue[$('select[name=group_5]').val()]);
                $("#width-value").text($('#textField0').val()+""+AttributesValue[$('input:radio[name=group_4]:checked').val()]);
                $("#drop-value").text($('#textField1').val()+""+AttributesValue[$('input:radio[name=group_4]:checked').val()]);
            }
            if(step == 2){
                $("#shape-value").text(AttributesValue[$('input:radio[name=group_6]:checked').val()]);
            }
            if(step == 3){
                $("#control-value").text(AttributesValue[$('select[name=group_7]').val()]);
            }
            if(step == 4){
                $('#qty_value').text($('#quantity_wanted').val());
                $("#child-value").text(AttributesValue[$('input:radio[name=group_9]:checked').val()]);
                $(".addtocartbutton").show();
                $('#summary-price').text(formatCurrency(finalPrice*$('#quantity_wanted').val(), currencyFormat, currencySign, currencyBlank)) 
                $('#finalPrice').val(finalPrice.toFixed(2))
            }
        }
        // PrestaShop internal settings
        var currentStep = 1;
        function openStep(id,next){
        if(id<currentStep||next){
        $(".container-step").slideUp();
        $("#content-"+id).slideDown();
        currentStep = id;
        
    }
}
var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}';
var currencyRate = '{$currencyRate|floatval}';
var currencyFormat = '{$currencyFormat|intval}';
var currencyBlank = '{$currencyBlank|intval}';
var taxRate = {$tax_rate|floatval};
var jqZoomEnabled = {if $jqZoomEnabled}true{else}false{/if};

//JS Hook
var oosHookJsCodeFunctions = new Array();

// Parameters
var id_product = '{$product->id|intval}';
var productHasAttributes = {if isset($groups)}true{else}false{/if};
var quantitiesDisplayAllowed = {if $display_qties == 1}true{else}false{/if};
var quantityAvailable = {if $display_qties == 1 && $product->quantity}{$product->quantity}{else}0{/if};
var allowBuyWhenOutOfStock = {if $allow_oosp == 1}true{else}false{/if};
var availableNowValue = '{$product->available_now|escape:'quotes':'UTF-8'}';
var availableLaterValue = '{$product->available_later|escape:'quotes':'UTF-8'}';
var productPriceTaxExcluded = {$product->getPriceWithoutReduct(true)|default:'null'} - {$product->ecotax};
var reduction_percent = {if $product->specificPrice AND $product->specificPrice.reduction AND $product->specificPrice.reduction_type == 'percentage'}{$product->specificPrice.reduction*100}{else}0{/if};
var reduction_price = {if $product->specificPrice AND $product->specificPrice.reduction AND $product->specificPrice.reduction_type == 'amount'}{$product->specificPrice.reduction|floatval}{else}0{/if};
var specific_price = {if $product->specificPrice AND $product->specificPrice.price}{$product->specificPrice.price}{else}0{/if};
var product_specific_price = new Array();
        {foreach from=$product->specificPrice key='key_specific_price' item='specific_price_value'}
    product_specific_price['{$key_specific_price}'] = '{$specific_price_value}';
        {/foreach}
    var specific_currency = {if $product->specificPrice AND $product->specificPrice.id_currency}true{else}false{/if};
    var group_reduction = '{$group_reduction}';
    var default_eco_tax = {$product->ecotax};
    var ecotaxTax_rate = {$ecotaxTax_rate};
    var currentDate = '{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}';
    var maxQuantityToAllowDisplayOfLastQuantityMessage = {$last_qties};
    var noTaxForThisProduct = {if $no_tax == 1}true{else}false{/if};
    var displayPrice = {$priceDisplay};
    var productReference = '{$product->reference|escape:'htmlall':'UTF-8'}';
    var productAvailableForOrder = {if (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}'0'{else}'{$product->available_for_order}'{/if};
    var productShowPrice = '{if !$PS_CATALOG_MODE}{$product->show_price}{else}0{/if}';
    var productUnitPriceRatio = '{$product->unit_price_ratio}';
    var idDefaultImage = {if isset($cover.id_image_only)}{$cover.id_image_only}{else}0{/if};
    var stock_management = {$stock_management|intval};
        {if !isset($priceDisplayPrecision)}
            {assign var='priceDisplayPrecision' value=2}
        {/if}
        {if !$priceDisplay || $priceDisplay == 2}
            {assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)}
            {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
        {elseif $priceDisplay == 1}
            {assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)}
            {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
        {/if}

    var productPriceWithoutReduction = '{$productPriceWithoutReduction}';
    var productPrice = '{$productPrice}';

    // Customizable field
    var img_ps_dir = '{$img_ps_dir}';
    var customizationFields = new Array();
        {assign var='imgIndex' value=0}
        {assign var='textFieldIndex' value=0}
        {foreach from=$customizationFields item='field' name='customizationFields'}
            {assign var="key" value="pictures_`$product->id`_`$field.id_customization_field`"}
        customizationFields[{$smarty.foreach.customizationFields.index|intval}] = new Array();    
        customizationFields[{$smarty.foreach.customizationFields.index|intval}][0] = '{if $field.type|intval == 0}img{$imgIndex++}{else}textField{$textFieldIndex++}{/if}';    
        customizationFields[{$smarty.foreach.customizationFields.index|intval}][1] = {if $field.type|intval == 0 && isset($pictures.$key) && $pictures.$key}2{else}{$field.required|intval}{/if};
        {/foreach}

    // Images
    var img_prod_dir = '{$img_prod_dir}';
    var combinationImages = new Array();

        {if isset($combinationImages)}
            {foreach from=$combinationImages item='combination' key='combinationId' name='f_combinationImages'}
        combinationImages[{$combinationId}] = new Array();
                {foreach from=$combination item='image' name='f_combinationImage'}
            combinationImages[{$combinationId}][{$smarty.foreach.f_combinationImage.index}] = {$image.id_image|intval};
                {/foreach}
            {/foreach}
        {/if}

    combinationImages[0] = new Array();
        {if isset($images)}
            {foreach from=$images item='image' name='f_defaultImages'}
        combinationImages[0][{$smarty.foreach.f_defaultImages.index}] = {$image.id_image};
            {/foreach}
        {/if}

    // Translations
    var doesntExist = '{l s='This combination does not exist for this product. Please choose another.' js=1}';
    var doesntExistNoMore = '{l s='This product is no longer in stock' js=1}';
    var doesntExistNoMoreBut = '{l s='with those attributes but is available with others' js=1}';
    var uploading_in_progress = '{l s='Uploading in progress, please wait...' js=1}';
    var fieldRequired = '{l s='Please fill in all required fields, then save the customization.' js=1}';
        {if isset($groups)}
    // Combinations
            {foreach from=$combinations key=idCombination item=combination}
        var specific_price_combination = new Array()    ;
        specific_price_combination['reduction_percent'] = {if $combination.specific_price AND $combination.specific_price.reduction AND $combination.specific_price.reduction_type == 'percentage'}{$combination.specific_price.reduction*100}{else}0{/if}    ;
        specific_price_combination['reduction_price'] = {if $combination.specific_price AND $combination.specific_price.reduction AND $combination.specific_price.reduction_type == 'amount'}{$combination.specific_price.reduction}{else}0{/if}    ;
        specific_price_combination['price'] = {if $combination.specific_price AND $combination.specific_price.price}{$combination.specific_price.price}{else}0{/if}    ;
        specific_price_combination['reduction_type'] = '{if $combination.specific_price}{$combination.specific_price.reduction_type}{/if}'    ;
        addCombination({$idCombination|intval}, new Array({$combination.list}), {$combination.quantity}, {$combination.price}, {$combination.ecotax}, {$combination.id_image}, '{$combination.reference|addslashes}', {$combination.unit_impact}, {$combination.minimal_quantity}, '{$combination.available_date}', specific_price_combination);
            {/foreach}
        {/if}

        {if isset($attributesCombinations)}
    // Combinations attributes informations
    var attributesCombinations = new Array();
            {foreach from=$attributesCombinations key=id item=aC}
        tabInfos = new Array()    ;
        tabInfos['id_attribute'] = '{$aC.id_attribute|intval}'    ;
        tabInfos['attribute'] = '{$aC.attribute}'    ;
        tabInfos['group'] = '{$aC.group}'    ;
        tabInfos['id_attribute_group'] = '{$aC.id_attribute_group|intval}';
        attributesCombinations.push(tabInfos);
            {/foreach}
        {/if}
    //]]>
    </script>

    {include file="$tpl_dir./breadcrumb.tpl"}
    <div id="primary_block" class="clearfix">
        <div id="bo_r">
            <h3>{$product->name|escape:'htmlall':'UTF-8'}</h3>
            <div id="rote">
                {if $have_image}
                    <span id="view_full_size">
                        <img src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')}" {if $jqZoomEnabled}class="jqzoom" alt="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox_default')}"{else} title="{$product->name|escape:'htmlall':'UTF-8'}" alt="{$product->name|escape:'htmlall':'UTF-8'}" {/if} id="bigpic" width="{$largeSize.width}" height="{$largeSize.height}" />
                    </span>
                {else}
                    <span id="view_full_size">
                        <img src="{$img_prod_dir}{$lang_iso}-default-large_default.jpg" id="bigpic" alt="" title="{$product->name|escape:'htmlall':'UTF-8'}" width="{$largeSize.width}" height="{$largeSize.height}" />
                        <span class="span_link">{l s='View full size'}</span>
                    </span>
                {/if}
                <!--<img id="bigpic"  src="{$img_dir}/door_ct.png">-->
            </div>

            <div id="bar_rote">
                <ul><li><a href="#"><img src="{$img_dir}/pb.png"><p>Product Details</p></a></li></ul>
                <ul><li id="li_mid"><a href="#"><span class="span_link"><img src="{$img_dir}/enlarge.png"><p>Enlarge</p></span></a></li></ul>
                <ul><li><a href="#"><img src="{$img_dir}/free.png"><p>Free sample</p></a></li></ul>

            </div>
        </div>
        <div id="mid_cust">
            <form id="buy_block" {if $PS_CATALOG_MODE AND !isset($groups) AND $product->quantity > 0}class="hidden"{/if} action="{$link->getPageLink('cart')}" method="post" action="#" method="get">
                <div id="attributes">
                    <p class="hidden">
                        <input type="hidden" name="token" value="{$static_token}" />
                        <input type="hidden" name="id_product" value="{$product->id|intval}" id="product_page_product_id" />
                        <input type="hidden" name="add" value="1" />
                        <input type="hidden" name="id_product_attribute" id="idCombination" value="" />
                        <input type="hidden" name="finalPrice" id="finalPrice" value="" />
                    </p>
                    <div id="step_top">
                        <ul>
                            <li><a id="st1" href="#">1</a></li>
                            <li><a id="st2" href="#">2</a></li>
                            <li><a id="st3" href="#">3</a></li>
                            <li><a id="st4" href="#">4</a></li>
                        </ul>
                    </div><!--End #Step_top-->
                    <div class="clear"></div>
                    <div id="step_mid">

                        <div id="sm_top" onclick="openStep(1,false)">
                            <p>1<span>Set your measurement</span></p>
                        </div>
                        <div class="clear"></div>
                        <div id="content-1" class="container-step">
                            <div id="sm_mid1">
                                <p>Enter your measurement ? <span>*</span></p>
                                <div class="clear"></div>
                                <div id="ratd">
                                    <p>
                                        <input type="radio" onclick="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');" checked="checked" value="21" name="group_4" class="attribute_radio">
                                        mm<br>
                                    </p>
                                    <p>
                                        <input type="radio" onclick="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');" value="22" name="group_4" class="attribute_radio">
                                        cm<br>
                                    </p>
                                    <p>
                                        <input type="radio" onclick="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');" value="23" name="group_4" class="attribute_radio">
                                        inches<br>
                                    </p></div>
                                <p></p>
                            </div>
                            <div class="clear"></div>

                            <div id="sm_mid2"><br>
                                <!-- Customizable products -->
                                {if isset($product) && $product->customizable}
                                    <div id="idTab10" class="bullet customization_block">

                                        <input type="hidden" value="{$customizationFormTarget}" id="customizationForm">
                                        {if $product->uploadable_files|intval}
                                            <div class="customizableProductsFile">
                                                <h3>{l s='Pictures'}</h3>
                                                <ul id="uploadable_files" class="clearfix">
                                                    {counter start=0 assign='customizationField'}
                                                    {foreach from=$customizationFields item='field' name='customizationFields'}
                                                        {if $field.type == 0}
                                                            <li class="customizationUploadLine{if $field.required} required{/if}">{assign var='key' value='pictures_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field}
                                                                {if isset($pictures.$key)}
                                                                    <div class="customizationUploadBrowse">
                                                                        <img src="{$pic_dir}{$pictures.$key}_small" alt="" />
                                                                        <a href="{$link->getProductDeletePictureLink($product, $field.id_customization_field)}" title="{l s='Delete'}" >
                                                                            <img src="{$img_dir}icon/delete.gif" alt="{l s='Delete'}" class="customization_delete_icon" width="11" height="13" />
                                                                        </a>
                                                                    </div>
                                                                {/if}
                                                                <div class="customizationUploadBrowse">
                                                                    <label class="customizationUploadBrowseDescription">{if !empty($field.name)}{$field.name}{else}{l s='Please select an image file from your hard drive'}{/if}{if $field.required}<sup>*</sup>{/if}</label>
                                                                    <input type="file" name="file{$field.id_customization_field}" id="img{$customizationField}" class="customization_block_input {if isset($pictures.$key)}filled{/if}" />
                                                                </div>
                                                            </li>
                                                            {counter}
                                                        {/if}
                                                    {/foreach}
                                                </ul>
                                            </div>
                                        {/if}
                                        {if $product->text_fields|intval}
                                            <div class="customizableProductsText">
                                                <ul id="text_fields">
                                                    {counter start=0 assign='customizationField'}
                                                    {foreach from=$customizationFields item='field' name='customizationFields'}
                                                        {if $field.type == 1}
                                                            <li class="customizationUploadLine{if $field.required} required{/if}">
                                                                <label for ="textField{$customizationField}">{assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field} {if !empty($field.name)}{$field.name}{/if}{if $field.required}<sup>*</sup>{/if}</label>
                                                                <input value="{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}" type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" class="customization_block_input" />
                                                            </li>
                                                            {counter}
                                                        {/if}
                                                    {/foreach}
                                                </ul>
                                            </div>
                                        {/if}
                                        <p id="customizedDatas">
                                            <input type="hidden" name="quantityBackup" id="quantityBackup" value="" />
                                            <input type="hidden" name="submitCustomizedDatas" value="1" />
                                            <input type="button" style="display: none" class="button" value="{l s='Save'}" onclick="javascript:saveCustomization()" />
                                            <span id="ajax-loader" style="display:none"><img src="{$img_ps_dir}loader.gif" alt="loader" /></span>
                                        </p>
                                    </div>
                                {/if}
                            </div>
                            <div id="sm_mid3">
                                <p><label>Exact or Recess?<span>*</span></label><br>
                                <div class="select1">
                                    <select onchange="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');" class="attribute_select" id="group_5" name="group_5">
                                        <option title="Exact - fitting your blind outside the window" selected="selected" value="24">Exact - fitting your blind outside the window</option>
                                        <option title="Recess - fitting your blind inside the window" value="25">Recess - fitting your blind inside the window</option>
                                    </select>
                                </div>
                                </p>
                            </div>
                            <div id="sm_bot">
                                {if !$priceDisplay || $priceDisplay == 2}
                                    {assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)}
                                    {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
                                {elseif $priceDisplay == 1}
                                    {assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)}
                                    {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
                                {/if}

                                <h3>
                                    {if $priceDisplay >= 0 && $priceDisplay <= 2}
                                        <span class="container-product-price" id="our_price_display">{convertPrice price=$productPrice}</span>
                                        <!--{if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
                                {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
                            {/if}-->
                        {/if}
                    </h3>

                    {if $product->on_sale}
                        <img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/>
                        <span class="on_sale">{l s='On sale!'}</span>
                    {elseif $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutReduction > $productPrice}
                        <span class="discount">{l s='Reduced price!'}</span>
                    {/if}
                    {if $priceDisplay == 2}
                        <br />
                        <span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>&nbsp;{l s='tax excl.'}</span>
                    {/if}
                    
                    <span class="next-button"onclick="changePriceBySize();addInfo(1);openStep(2,true);saveCustomization()">Next Step</span>
                </div>
            </div>
        </div><!--End #Step_mid-->
        <div class="clear"></div>

        <div id="step_mid">
            <div id="sm_top" onclick="openStep(2,false)">
                <p>
                    2
                    <span>Choose an End/Scallop</span>
                </p>
            </div>
            <div class="clear"></div>
            <div id="content-2" class="container-step"style="display: none">
                <div id="sm_mid1">
                    <p>Select your Shape/Scallop <span>*</span></p>
                    <div class="clear"></div>
                    <div id="ratd">
                        <p>
                            <input class="attribute_radio" name="group_6" value="26" checked="checked" onclick="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');" type="radio">
                            Straight<br>
                        </p>
                        <p>
                            <input class="attribute_radio" name="group_6" value="27" onclick="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');" type="radio">
                            Soft Scallop <br>
                        </p>
                        <p>
                            <input class="attribute_radio" name="group_6" value="28" onclick="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');" type="radio">
                            Stiff Scallop<br>
                        </p>
                        <p>
                            <input class="attribute_radio" name="group_6" value="29" onclick="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');" type="radio">
                            Turret<br>
                        </p>
                    </div>
                    <p></p>
                </div>
                <div class="clear"></div>

                <div id="sm_bot">
                    {if !$priceDisplay || $priceDisplay == 2}
                        {assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)}
                        {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
                    {elseif $priceDisplay == 1}
                        {assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)}
                        {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
                    {/if}

                    <h3>
                        {if $priceDisplay >= 0 && $priceDisplay <= 2}
                            <span class="container-product-price" id="our_price_display">{convertPrice price=$productPrice}</span>
                            <!--{if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
                    {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
                {/if}-->
                {/if}
                </h3>

                {if $product->on_sale}
                    <img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/>
                    <span class="on_sale">{l s='On sale!'}</span>
                {elseif $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutReduction > $productPrice}
                    <span class="discount">{l s='Reduced price!'}</span>
                {/if}
                {if $priceDisplay == 2}
                    <br />
                    <span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>&nbsp;{l s='tax excl.'}</span>
                {/if}
                <span class="next-button"onclick="addInfo(2);openStep(3,true)">Next Step</span>
            </div>
        </div>
    </div>

    <div class="clear"></div>
    <div id="step_mid">
        <div id="sm_top" onclick="openStep(3,false)">
            <p>
                3
                <span>Choose Controls</span>
            </p>
        </div>
        <div class="clear"></div>
        <div id="content-3"  class="container-step" style="display: none">
            <div id="sm_mid1">
                <p>Choose a Control Mechanism <span>*</span></p>
                <div class="select1">
                    <select onchange="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');;" class="attribute_select" id="group_7" name="group_7">
                        <option title="Left Side Chain" selected="selected" value="30">Left Side Chain</option>
                        <option title="Right Side Chain" value="31">Right Side Chain</option>
                        <option title="Spring Operated" value="32">Spring Operated</option>
                    </select>
                </div>
            </div>
            <div id="sm_mid1">
                <p>Chain Colour : </p>

                <p>
                    <input class="attribute_radio" name="group_8" value="33" checked="checked" onclick="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');" type="radio">
                    White<br>
                </p>
                <p>
                    <input class="attribute_radio" name="group_8" value="34" onclick="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');" type="radio">
                    Chrome (+ €4)<br>
                </p>

            </div>
            <div class="clear"></div>
            <div id="sm_bot">
                {if !$priceDisplay || $priceDisplay == 2}
                    {assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)}
                    {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
                {elseif $priceDisplay == 1}
                    {assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)}
                    {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
                {/if}

                <h3>
                    {if $priceDisplay >= 0 && $priceDisplay <= 2}
                        <span class="container-product-price" id="our_price_display">{convertPrice price=$productPrice}</span>
                        <!--{if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
                {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
            {/if}-->
            {/if}
            </h3>

            {if $product->on_sale}
                <img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/>
                <span class="on_sale">{l s='On sale!'}</span>
            {elseif $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutReduction > $productPrice}
                <span class="discount">{l s='Reduced price!'}</span>
            {/if}
            {if $priceDisplay == 2}
                <br />
                <span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>&nbsp;{l s='tax excl.'}</span>
            {/if}
            <span class="next-button"onclick="addInfo(3);openStep(4,true)">Next Step</span>
        </div>
    </div>
</div>
<div id="step_mid">
    <div id="sm_top" onclick="openStep(4,false)">
        <p>
            4
            <span>Set quantity and optional info</span>
        </p>
    </div>
    <div class="clear"></div>
    <div id="content-4" class="container-step" style="display: none">

        <div id="sm_mid1">
            <p id="quantity_wanted_p">
                <label>Quantity:</label>
                <input type="text" maxlength="3"  onchange=""size="2" value="1" class="text" id="quantity_wanted" name="qty">
            </p>
            {if $product->minimal_quantity > 1}
                <script type="text/javascript">
            checkMinimalQuantity();
                </script>
            {/if}
        </div>
        <div id="sm_mid1">
            <p id="quantity_wanted_p">
            <p>A child safety device :</p>
            <input class="attribute_radio" name="group_9" value="35" checked="checked" onclick="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');" type="radio">
            yes<br>
            <input class="attribute_radio" name="group_9" value="36" onclick="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');" type="radio">
            no<br>
            </p>
        </div>
        <div class="clear"></div>
        <div id="sm_bot">

            <h3>
                <span class="container-product-price" id="our_price_display">{convertPrice price=$productPrice}</span>
                <!--            tax incl.        -->
            </h3>
                <span class="next-button"onclick="addInfo(4);openStep(5,true)">Next Step</span> 
        </div>


    </div>
</div>


<!--   end  div#bo_r -->
<!-- start div#mid_cust  -->



<!-- end  div#mid_cust  -->
<!-- start div#add_cart -->
</div>

</div>
<div id="add_cart">
    <div id="top_or">
        <h4>Order Summary</h4>
    </div>    
    <div id="info_or">
        <div class="order_info">
            <h4>1.Set your measurement</h4>
            <p><span>Width: </span><span class="attribute_value" id="width-value"></span></p>
            <p><span>Drop: </span><span class="attribute_value" id="drop-value"></span></p>
            <p><span>Exact or Recess:</span><br/><span class="attribute_value" id="exact-value"></span></p>
        </div>

        <div class="order_info">
            <h4>2.Choose an End/Scallop</h4>
            <p><span>Shape: </span><span class="attribute_value" id="shape-value"></span></p>
        </div>

        <div class="order_info">
            <h4>3.Choose Controls</h4>
            <p><span>Control Mechanism:</span><br/><span class="attribute_value" id="control-value"></span></p>
        </div>
        <div id="bot_or">
            <h4>4.Set quantity and optional info</h4>
            <p><span>Child Safety Device: </span><span class="attribute_value" id="child-value"></span></p>
        </div>

    </div><!--End #info_or-->

    <div id="add_cart_bot">
        <div id="quali">
            <p>
                <span class="top_p1">
                    Qty:
                </span>
                <span id="qty_value" class="top_p2">
                    1
                </span>
            </p>
            <p>
                <span class="top_p1">
                    Price:
                </span>
                <span id="summary-price" class="top_p2">
                    {convertPrice price=$productPrice}
                </span>
            </p>
        </div>
        <div style="display: none" class="addtocartbutton">
            <p class=""  id="add_to_cart"><span></span><input  id="button-add-to-cart" type="submit" class="exclusive" value="Add to cart" name="Submit"></p>
            <!--<a class="ajax_add_to_cart_button" href="{$link->getPageLink('cart', true, NULL, "id_product={$product->id|intval}&amp;token={$static_token}&amp;add")}" rel="ajax_id_product_{$product->id|intval }" title="{l s='Add to Cart'}">{l s='Add to cart'}</a>-->
            <!-- add to cart button -->
        </div>
    </div><!--End #add_cart_bot-->
</div>
</div>
</form>
<!-- end  div#add_cart -->

<div class="clear"></div>

<!-- start div#sym_info System infor  -->
<div id="sym_info">
    <div id="tit">
        <h3>Set your measurement</h3>
    </div>
    <div class="sym_i">
        <h3>fabric type:</h3>
        <p>5th Avenue - UV treated 100% plyster - crylic back coating</p>
    </div>

    <div class="sym_i">
        <h3>size range:</h3>
        <p>Width - 630mm to 1830mm Drop - 600mm to 2400mm</p>
    </div>

    <div class="sym_i">
        <h3>inner tube</h3>
        <p>38mm standdard</p>
    </div>

    <div class="sym_i">
        <h3>bracket dimensions:</h3>
        <p>N/A</p>
    </div>

    <div class="sym_i">
        <h3>bracket suitable for:</h3>
        <p class="checkboxaction">


            <input type="checkbox" value="side fixing" id="sidefixing" />
            <label for="sidefixing"><span></span>side fixing</label>
            <input type="checkbox" value="top fixing" id="topfixing" />
            <label for="topfixing"><span></span>top fixing</label>
            <input type="checkbox" value="side bac fixing" id="backfixing" />
            <label for="backfixing"><span></span>back fixing</label>
        </p>
    </div>

    <div class="sym_i">
        <h3>controlmechanism/s:</h3>
        <p>Chain drive to lift and lower blind</p>
    </div>

    <div class="sym_i">
        <h3>control side:</h3>
        <p>Left or Right hand side</p>
    </div>

    <div class="sym_i">
        <h3>base rail:</h3>
        <p>Flat Shaped Powder coated aluminium with fabric inser</p>
    </div>

    <div class="sym_i">
        <h3>rail colours:</h3>
        <p>Beige, Birch White, Chrome, Clear Andized, Ebony, Gold, Grey  Primrose and White</p>
    </div>

    <div class="sym_i">
        <h3>Chain leght</h3>
        <p>N/A</p>
    </div>

    <div id="sym_i_last">
        <h3>Chain colours</h3>
        <p>Beige, Birch White, Ebony, Grey Silver and White</p>
    </div>

</div>

<!-- end div#sym_info  system infor -->
<!-- start div#mid_lane -->
<div id="mid_lane">
    <div class="mid_l">
        <h3>Care &amp; Maintenance</h3>
        <p>For easy to clean intructions, visit our <a href="#">How to Clean Roller Blings</a> page.</p>
    </div>

    <div class="mid_l">
        <h3>Hardware</h3>
        <p>Fully assembled blind Installation screws Mounting brackets for inside or outside mount
            Colour matched pelmet Pelmet installation clips (attach pelmet to head box)</p>
    </div>
</div>
<!-- en div#mid_lane -->
<!-- start div#right_lane  -->
<div id="right_lane">
    <h3><span>Guide</span></h3>
    <p>Roller Blinds Fitting Instructions</p>
    <a href="#">Download (PDF, 1.21 MB) &gt;</a>
</div>
<!-- end  div#right_lane  -->
{/if}


